package net.danielpaz.pucc.poo.trabalho.model;

import java.sql.*;

import javax.swing.JOptionPane;

import net.danielpaz.pucc.poo.trabalho.model.BD;
import net.danielpaz.pucc.poo.trabalho.control.Control;



public class GUIteste {
	//private AlbumDAO album;
	public static BD bd;
	private static PreparedStatement statement;
	private static ResultSet resultSet;
    //private static PreparedStatement statement;
    
public static void main(String[] args) throws SQLException {
	
	
	/*insert album 
	String id="10", nome="teste";
	
	Album album = new Album(id,nome);
	
	AlbumDAO albumdao = new AlbumDAO();
	
	 if (!albumdao.bd.getConnection()) {
         JOptionPane.showMessageDialog(null, "Falha na conexao, o sistema sera fechado!");
         System.exit(0);
     }
	
	JOptionPane.showMessageDialog(null, albumdao.atualizar(AlbumDAO.INCLUSAO, album));
*/
	
/*	
//dao gerente

	Gerente gerente = new Gerente(1, null, 1, null, 1, null, 1, 1, 1, 1, null, null);
	
	GerenteDAO gerenteDAO = new GerenteDAO();
	
	 if (!gerenteDAO.bd.getConnection()) {
         JOptionPane.showMessageDialog(null, "Falha na conexao, o sistema sera fechado!");
         System.exit(0);
     }
	
	//JOptionPane.showMessageDialog(null, gerenteDAO.atualizar(GerenteDAO.INCLUSAO, gerente));
	JOptionPane.showMessageDialog(null, gerenteDAO.atualizar(GerenteDAO.EXCLUSAO, gerente));
	*/
	
	
	/*
//dao atendente
	
	Atendente atendente = new Atendente(0, null, 0, null, 0, null, 0, 0);
	AtendenteDAO atendenteDAO = new AtendenteDAO();
	
	if (!atendenteDAO.bd.getConnection()) {
        JOptionPane.showMessageDialog(null, "Falha na conexao, o sistema sera fechado!");
        System.exit(0);
    }

	//JOptionPane.showMessageDialog(null, atendenteDAO.atualizar(AtendenteDAO.INCLUSAO, atendente));
	JOptionPane.showMessageDialog(null, atendenteDAO.atualizar(AtendenteDAO.EXCLUSAO, atendente));
		*/
	
   // Gerente gerente = new Gerente(1, null, null, 0, 0, 0);
    
	//GerenteDAO gerenteDAO = new GerenteDAO();
	
	//if (!gerenteDAO.bd.getConnection()) {
    //    JOptionPane.showMessageDialog(null, "Falha na conexao, o sistema sera fechado!");
    //    System.exit(0);
    //}
	//JOptionPane.showMessageDialog(null, gerenteDAO.localizar(GerenteDAO.INCLUSAO, gerente));
	//JOptionPane.showMessageDialog(null, gerenteDAO.atualizar(GerenteDAO.INCLUSAO, gerente));
	//JOptionPane.showMessageDialog(null, gerenteDAO.atualizar(GerenteDAO.EXCLUSAO, gerente));
	
	
	//------------------------------------------TESTEALBUM-------------------------------------//
	/*System.out.println("teste album");
	Album album = new Album(3, null, 0, 0, 0, 0);
	AlbumDAO albumDAO = new AlbumDAO();
	if (!albumDAO.bd.getConnection()) {
        JOptionPane.showMessageDialog(null, "Falha na conexao, o sistema sera fechado!");
        System.exit(0);
    }
	System.out.println("insere no banco");
	JOptionPane.showMessageDialog(null, albumDAO.atualizar(AlbumDAO.INCLUSAO, album));
	
	System.out.println("modifica no banco");
	album = new Album(1, null, 2, 3, 4, 5);
	JOptionPane.showMessageDialog(null, albumDAO.atualizar(AlbumDAO.ALTERACAO, album));
		
	System.out.println("le no banco");
	JOptionPane.showMessageDialog(null, albumDAO.localizar(AlbumDAO.INCLUSAO, album));
	System.out.println(album.getId() + " " + album.getNome()  + " " + album.getIdCantor()  + " " + album.getIdMidia()  + " " + album.getPreco()  + " " + album.getQuantidade() );
	
	System.out.println("apaga no banco");
	Album album = new Album(0, null, 2, 3, 4, 5);
	JOptionPane.showMessageDialog(null, albumDAO.localizar(AlbumDAO.EXCLUSAO, album));
	Album album = new Album(1, null, 2, 3, 4, 5);
	JOptionPane.showMessageDialog(null, albumDAO.localizar(AlbumDAO.EXCLUSAO, album));
	Album album = new Album(3, null, 2, 3, 4, 5);
	JOptionPane.showMessageDialog(null, albumDAO.localizar(AlbumDAO.EXCLUSAO, album));
	System.out.println("FIM teste album");*/
	
	
}
}
